<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>清除浮动</title>
  <style>
    .parent {
      width: 800px;
      background: antiquewhite;
      border: 1px solid red;
    }
    .children1 {
      float: left;
      width: 200px;
      height: 100px;
      background-color: #005971;
    }

    .children2 {
      float: left;
      height: 120px;
      width: 300px;
      background-color: #002183;
    }

    .next {
      height: 150px;
      width: 100%;
      background-color: burlywood;
    }
    /* 方式一 额外标签法 */
    .clearF{
      clear: both;
    }
    /* overflow: hidden; */
    .parent1 {
      width: 800px;
      background: antiquewhite;
      border: 1px solid red;
      overflow: hidden;
    }
    /*  伪类 */
    .clearFloat1:after{
      content: "";
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
    }
    .clearFloat1 {/* IE6 7专用 */
      *zoom: 1;
    }
    /* 伪类2 */
    .clearFix:after,
    .clearFix:before{
      content: "";
      display: table;
    }
    .clearFix:after{
      clear: both;
    }
    .clearFix {/* IE6 7专用 */
      *zoom: 1;
    }

  </style>
</head>

<body>
  <div class="parent">
    <div class="children1"></div>
    <div class="children2"></div>
    <div class="clearF"></div>
  </div>
  <div class="next"></div>
  <div style="height: 20px;width: 100%;">1111</div>
  <div class="parent1">
    <div class="children1"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
  </div>
  <div class="next"></div>
  <div style="height: 20px;width: 100%;">2222</div>
  <div class="parent clearFloat1">
    <div class="children1"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
  </div>
  <div class="next"></div>
  <div style="height: 20px;width: 100%;">333</div>
  <div class="parent clearFix">
    <div class="children1"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
    <div class="children2"></div>
  </div>
  <div class="next"></div>
</body>

</html>